home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club (Business) 1997 July / Software of the Month Club - Business (Volume 239) (July 1997).iso / pc / code / e.dxr / 00005_enter&exitKF scripts.ls next >
Encoding:
Text File  |  1996-02-15  |  4.0 KB  |  120 lines

  1. global gWorld, gStates, gEnvironmentSound, gNextDIRFile, NULLrect, gHotRects, gCursorlist, gObjects, gTimerList, gGlobal, sQTCharSprite
  2.  
  3. on enterE01
  4.   if getaProp(getaProp(gObjects, #CarDash), #State) = #on then
  5.     playSound("E01idle.aif", #cast, 0)
  6.   end if
  7.   set radObj to getaProp(gObjects, #CarRadio)
  8.   if getaProp(radObj, #State) = #on then
  9.     set whichStation to "E01rad" & getaProp(radObj, #station) & ".aif"
  10.     playSound(whichStation, #AmbientLoop, 0)
  11.   end if
  12.   if gGlobal = 1 then
  13.     setaProp(gStates, #Credits, getaProp(gStates, #Credits) + 90)
  14.   end if
  15.   set runoutCount to getaProp(getaProp(gObjects, #CarGasGauge), #runoutCount)
  16.   Startthetimer(5, "doEmergencyBlinker")
  17.   if runoutCount = 3 then
  18.     PDARelease("J04m25p.mov")
  19.   else
  20.     if runoutCount = 6 then
  21.       PDARelease("J04m19p.mov")
  22.     end if
  23.   end if
  24.   if voidp(getaProp(getaProp(gStates, #BeenThere), #E01)) then
  25.     PDARelease("J05coast.mov")
  26.   end if
  27. end
  28.  
  29. on doEmergencyBlinker
  30.   set carEmerObj to getaProp(gObjects, #carEmer)
  31.   if not voidp(getaProp(carEmerObj, #animator)) then
  32.     setaProp(getaProp(carEmerObj, #animator), #pbPauseState, 1)
  33.   end if
  34.   set SpriteNum to getaProp(carEmerObj, #SpriteNum)
  35.   if getaProp(getaProp(gObjects, #carEmerPar), #State) = #stranded then
  36.     set initList to [#carEmerHotRect]
  37.     set killList to []
  38.     changeHotSpots(initList, killList, #true)
  39.     set whichCast to getAt(getaProp(getaProp(carEmerObj, #cast), #FrameData), 2)
  40.   else
  41.     set whichCast to getaProp(getaProp(carEmerObj, #cast), #frameDataStart)
  42.     setaProp(getaProp(gObjects, #carEmerPar), #State, #off)
  43.   end if
  44.   set the castNum of sprite SpriteNum to whichCast
  45. end
  46.  
  47. on exitE01
  48.   stopsound("E02knock.aif")
  49. end
  50.  
  51. on enterE02
  52.   setMapVar()
  53.   set E04gas01Count to getaProp(getaProp(gObjects, #GasManQT), #E04gas01Count)
  54.   if E04gas01Count = 1 then
  55.     PDARelease("J04m15p.mov")
  56.     setaProp(getaProp(gObjects, #GasManQT), #E04gas01Count, 2)
  57.   else
  58.     if E04gas01Count = 2 then
  59.       PDARelease("J04m17p.mov")
  60.       setaProp(getaProp(gObjects, #GasManQT), #E04gas01Count, 3)
  61.     end if
  62.   end if
  63. end
  64.  
  65. on doTextFldFormat
  66.   put " " into field "GasPINDisplay.txt"
  67.   set the textFont of field "GasPINDisplay.txt" to "Monaco"
  68.   set the textSize of field "GasPINDisplay.txt" to 12
  69.   set the foreColor of field "GasPINDisplay.txt" to getIndex([8: 157, 16: 32766, 32: 16580595])
  70.   put EMPTY into field "GasPINDisplay.txt"
  71. end
  72.  
  73. on doMapSetUp
  74.   setMapPos()
  75. end
  76.  
  77. on enterE04
  78.   pickGasMan(1)
  79.   set gasManObj to getaProp(gObjects, #GasManQT)
  80.   set curZone to getaProp(getaProp(gObjects, #carMap), #curZone)
  81.   set stationNum to getPos(getaProp(gasManObj, #stationLocs), curZone)
  82.   if stationNum = 12 then
  83.     PDARelease("J04m20p.mov")
  84.   end if
  85. end
  86.  
  87. on exitE04
  88.   if getaProp(getaProp(gObjects, #CarGasGauge), #runoutCount) = 4 then
  89.     setaProp(getaProp(gObjects, #CarGasGauge), #runoutCount, 5)
  90.   end if
  91.   doResetPINScreen(#enterPIN, 0)
  92. end
  93.  
  94. on enterE06
  95.   global gLastKeyList
  96.   set lastKey to string(getaProp(gLastKeyList, #RefName))
  97.   set radObj to getaProp(gObjects, #CarRadio)
  98.   if getaProp(radObj, #State) = #on then
  99.     set whichStation to "E01rad" & getaProp(radObj, #station) & ".aif"
  100.     playSound(whichStation, #AmbientLoop, 0)
  101.   end if
  102.   if (lastKey = "F64") or (lastKey = "G12") or (lastKey = "G22") or (lastKey = "H15") then
  103.     set dashObj to getaProp(gObjects, #carDashView)
  104.     setaProp(getaProp(dashObj, #cast), #UP, the number of cast "EFK.pct")
  105.     setaProp(getaProp(gObjects, #pelletDispenserParent), #State, #on)
  106.     set initList to [#lookAtPelletDispenser]
  107.     set killList to [#carLookLeft, #carLookRight]
  108.     changeHotSpots(initList, killList, #false)
  109.   end if
  110. end
  111.  
  112. on changeMultistate newStateNum, OBJref
  113.   set OBj to getaProp(gObjects, OBJref)
  114.   set newState to getAt(getaProp(OBj, #allStates), newStateNum)
  115.   MakeDynamic(OBJref, #DisplayState, newState)
  116.   set OBJSprite to getaProp(OBj, #SpriteNum)
  117.   set newCast to the number of cast getaProp(getaProp(OBj, #cast), getaProp(OBj, #DisplayState))
  118.   set the castNum of sprite OBJSprite to newCast
  119. end
  120.